package edu.pku.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import edu.pku.data.OutReplayPrice;
import edu.pku.util.MySqlMapClient;

public class OutReplayPriceDao {
	
	public void addOutReplayPrice(OutReplayPrice orp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.insert("insert_out_replayprice",orp);
	}
	
	public void updateOutReplayPrice(OutReplayPrice orp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.update("update_out_replayprice",orp);
	}
	
	public List<OutReplayPrice> getOutReplayPrices(String companyName) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		List<OutReplayPrice> list =  sqlMap.queryForList("get_out_replayprices",companyName);
		return list;
	}
	
	public void deleteOutReplayPrice(OutReplayPrice orp) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.delete("delete_out_replayprice",orp);
	}
	
	
}
